import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Demo5 {
    public static void main(String[] args) {
        LocalDate localDate = LocalDate.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd");

        System.out.println(localDate.format(formatter));    //指定格式输出
        System.out.println(localDate);                      //默认格式输出
    }
}
